Skip to content

Resolve ApiLink targets from generated registry#64

Open
viktorkombov wants to merge 10 commits into
masterfrom
vkombov/resolve-api-docs-urls
Open

Resolve ApiLink targets from generated registry#64
viktorkombov wants to merge 10 commits into
masterfrom
vkombov/resolve-api-docs-urls

Conversation

@viktorkombov
Copy link
Copy Markdown
Collaborator

@viktorkombov viktorkombov commented May 29, 2026

Summary

Updates ApiLink to resolve API documentation links from a generated local registry instead of encoding platform-specific package/kind/suffix rules in MDX.

Changes

  • Added registry-based ApiLink resolution through platformContext.apiLinkIndex.
  • Uses generated symbol data for package, kind, URL, and member anchors.
  • Keeps pkg as an optional filter for ambiguous symbol names.
  • Removed remote registry fetching and endpoint-root configuration.
  • Updated ApiLink README with the local registry contract and compact field meanings.

Testing

  • Ran focused TypeScript checks for ApiLink registry code and shared types.
  • Verified Web Components chart symbols resolve from registry data.

@viktorkombov viktorkombov changed the title Resolve ApiLink URLs from api-docs symbol index Resolve ApiLink targets from generated registry Jun 2, 2026
Comment thread src/components/mdx/ApiLink/api-link-index.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the ApiLink MDX component to resolve TypeDoc API documentation URLs via a build-time, platform-provided registry (platformContext.apiLinkIndex) instead of hard-coded platform/package URL rules in MDX, while keeping a legacy URL-generation fallback.

Changes:

  • Add registry-based TypeDoc symbol resolution (including member anchors) via platformContext.apiLinkIndex.
  • Refactor ApiLink.astro to use index resolution first (when available) and keep legacy URL generation as a fallback path.
  • Document the local registry contract/fields in the ApiLink README and extend PlatformContext with apiLinkIndex.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/lib/types.ts Extends PlatformContext with optional apiLinkIndex and updates classSuffix docs to reflect registry-driven behavior.
src/components/mdx/ApiLink/README.md Updates docs to describe registry-based resolution, preferred authoring style, and the compact index schema.
src/components/mdx/ApiLink/ApiLink.astro Implements index-first resolution with legacy fallback and updates prop handling for registry lookup.
src/components/mdx/ApiLink/api-link-index.ts Adds the index lookup/resolution utilities (candidate-name generation, member-anchor mapping, URL absolutization).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/mdx/ApiLink/api-link-index.ts Outdated
Comment thread src/components/mdx/ApiLink/api-link-index.ts Outdated
Comment thread src/components/mdx/ApiLink/ApiLink.astro Outdated
Comment thread src/components/mdx/ApiLink/api-link-index.ts Outdated
Comment thread src/components/mdx/ApiLink/ApiLink.astro
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

Comment thread src/components/mdx/ApiLink/ApiLink.astro
Comment thread src/components/mdx/ApiLink/ApiLink.astro
Comment thread src/components/mdx/ApiLink/ApiLink.astro
Comment thread src/components/mdx/ApiLink/ApiLink.astro
Comment thread src/components/mdx/ApiLink/README.md
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread src/components/mdx/ApiLink/api-link-index.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread src/components/mdx/ApiLink/api-link-index.ts
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread src/lib/types.ts
Comment thread src/components/mdx/ApiLink/README.md Outdated
Comment thread src/components/mdx/ApiLink/ApiLink.astro
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread src/components/mdx/ApiLink/ApiLink.astro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

❌ status: awaiting-test PRs awaiting manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants